package com.design.design.pattern.creational.factory.simplefactory;

/**
 * @author TomDragon
 */
public class Test {
    public static void main(String[] args) {
        // original: cause to use the simple factory pattern TODO

        // method1
        VideoFactory01 videoFactory01 = new VideoFactory01();
        Video videoJava = videoFactory01.getVideo("java");
        Video videoPython = videoFactory01.getVideo("python");
        if (videoJava == null || videoPython == null) {
            return;
        }
        videoJava.produce();
        videoPython.produce();

        // method2
        Video videoJ = VideoFactory02.getVideo(JavaVideo.class);
        Video videoP = VideoFactory02.getVideo(PythonVideo.class);
        videoJ.produce();
        videoP.produce();
    }
}
